
package com.shop.cloud.mall.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.cloud.common.core.constant.CacheConstants;
import com.shop.cloud.mall.common.entity.UserGradeConfig;
import com.shop.cloud.mall.admin.mapper.UserGradeConfigMapper;
import com.shop.cloud.mall.admin.service.UserGradeConfigService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

/**
 * 用户等级配置
 *
 * @author
 * @date 2023-03-15 14:18:57
 */
@Service
public class UserGradeConfigServiceImpl extends ServiceImpl<UserGradeConfigMapper, UserGradeConfig> implements UserGradeConfigService {

	@Override
	@CacheEvict(value = CacheConstants.MALL_USERGRADE_CONFIG_CACHE, key = "#entity.grade")
	public boolean updateById(UserGradeConfig entity) {
		return super.updateById(entity);
	}

	@Override
	@CacheEvict(value = CacheConstants.MALL_USERGRADE_CONFIG_CACHE, key = "#queryWrapper.entity.grade")
	public boolean remove(Wrapper<UserGradeConfig> queryWrapper) {
		return super.removeById(queryWrapper.getEntity().getId());
	}

}
